package com.longrise.co.ui.mine.fragment;

import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;

import com.longrise.co.R;
import com.longrise.co.ui.mine.contract.MineContract;
import com.longrise.co.ui.mine.model.MineModel;
import com.longrise.co.ui.mine.presenter.MinePresenter;
import com.ly.common.base.BaseFragment;

import butterknife.Bind;
import butterknife.OnClick;

/**
 * Created by luoyang on 2017-7-20.
 */

public class ModifyMobileFragment extends BaseFragment<MinePresenter, MineModel> implements MineContract.View<String> {

    @Bind(R.id.head_title)
    TextView headTitle;
    @Bind(R.id.mobile)
    EditText mobile;
    @Bind(R.id.send_sms)
    TextView sendSms;
    @Bind(R.id.sms_code)
    EditText smsCode;

    private String mMobile;

    @Override
    protected int getLayoutResource() {
        return R.layout.fg_modify_phone_number;
    }

    @Override
    public void initPresenter() {
        mPresenter.setVM(this, mModel);
    }

    @Override
    protected void initView() {
        mMobile = getArguments().getString("mobile");
        setText(headTitle, "手机号码");
    }

    @Override
    public void requestSuccess(String s) {

    }

    @Override
    public void onRequestComplete() {

    }

    public static ModifyMobileFragment newInstance(String mobile) {
        
        Bundle args = new Bundle();
        args.putString("mobile", mobile);
        ModifyMobileFragment fragment = new ModifyMobileFragment();
        fragment.setArguments(args);
        return fragment;
    }


    @OnClick({R.id.head_back, R.id.send_sms, R.id.submit})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.head_back:
                _mActivity.onBackPressed();
                break;
            case R.id.send_sms:
                break;
            case R.id.submit:
                break;
        }
    }
}
